package com.atguigu.chapter05.Source;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;

/**
 * TODO
 *
 * @author cjp
 * @version 1.0
 * @date 2021/3/3 14:19
 */
public class Flink01_Collection {
    public static void main(String[] args) throws Exception {
//        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(new Configuration());

        // TODO Source - 从集合读
        env
//                .fromCollection(Arrays.asList(1, 2, 3, 4, 5))
//                .fromElements(1,2,3,4,5)
                .socketTextStream("localhost",9999 )
                .print();



        env.execute();
    }
}
